<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="ko">
<head>
    <%@ include file="/include/header.jsp" %>
	<%@ include file="/include/commonRes.jsp" %>
	<link rel="stylesheet" href="<%=cp %>/css/default.css">
    <link rel="stylesheet" href="<%=cp %>/css/board.css">
    <script type="text/javascript">
    	$(function(){
    		$("#btn_save").click(function(){
    			
    			
    			
    			
    			
    			
    			
    			$("#answerForm").submit();
    			return false;
    		});
			
    		$("#btn_cancel").click(function(){
    			history.back();
    			return false;
    		});
    	});
    
    </script>
</head>
<body>
	<div id="hd_login_msg">${sessionScope.ss_mb.mb_name} 로그인 중 <a href="<%=cp %>/logout.do">로그아웃</a></div>
	<%@include file="/include/mainMenuHeader.jsp" %>
	<div id="wrapper">
		<c:if test="${sessionScope.ss_mb.mb_id==mb_id }">
			<h2>나의 Teamtouch</h2>
		</c:if>
		<c:if test="${sessionScope.ss_mb.mb_id!=mb_id }">
			<c:forEach var="item1" items="${qnaList }">
				<c:if test="${item1.bizNo==1 }">
					<h2>${item1.regName}의 Teamtouch</h2>
				</c:if>
			</c:forEach>
		</c:if>
		<!-- 
		<nav id="bo_cate">
			<ul id="artice_area">
				<li>
					<a href="#" id="dept_all" class="blackBold">나의 Teamtouch</a>
				</li>
				<li>
					<a href="#" id="dept_service1" >서비스1과</a>
				</li>			
			</ul>
		</nav>
		-->
		<form id="answerForm" name="answerForm" action="<%=cp %>/teamt/teamt_answer.do" method="post">
			<div class="T_date">
				<input type="hidden" name="paramDay" value="${paramDay }"/>	     
				<span>Teamtouch : </span>
				<span>${paramDay }</span>   
				<input type="hidden" name="mode" value="${mode }"> 
				<input type="hidden" name="mb_id" value="${mb_id }"/>
			</div>
			<c:forEach var="item" items="${qnaList }" varStatus="status">
				<c:if test="${item.bizNo==1 }">
					<input type="hidden" name="bizNo" value="${item.bizNo }"/>
				</c:if>
				<!-- 질문 _0${item.bizNo } -->   
					
				<c:if test="${item.bizNo ==5 }">
					<div class="T_qna">
						<input type="hidden" name="bizNo${item.bizNo }" value="${item.bizNo }"/>
				    	<input type="hidden" name="bizName${item.bizNo }" value="${item.bizName }"/>
					
						<span class="Q">${item.bizNo }.  ${item.bizName }
							<c:if test="${not empty item.personScore }">
								<span class="A5_S">${item.personScore }점</span>
							</c:if>
							<c:if test="${not empty item.score && authType=='C'}">
								<span class="S">${item.score }점</span>
							</c:if>
						</span>
					</div>
				</c:if>
			
				<c:if test="${item.bizNo !=5}">
				
					<div class="T_qna">
						<input type="hidden" name="bizNo${item.bizNo }" value="${item.bizNo }"/>
				    	<input type="hidden" name="bizName${item.bizNo }" value="${item.bizName }"/>
						<span class="Q">${item.bizNo }.  ${item.bizName }
							<c:if test="${not empty item.score && authType=='C'}">
								<span class="S">${item.score }점</span>
							</c:if>
			       		</span> 
						<c:if test="${item.bizNo==1 ||item.bizNo==2 }">
			       			
			       			<c:if test="${not empty questionsList }">
			       				<c:forEach var="item1" items="${questionsList }" varStatus="status1">
					       			<c:if test="${item.bizNo==1 && item.bizNo==item1.bizNo}">
					       				<div class="value_area">
							              	${item1.q_emp_name1 }
						              	</div>
						       			<div class="value_area">
							              	${item1.q_emp_name2 }
						              	</div>
						              	<div class="value_area">
							              	${item1.q_emp_name3 }
						              	</div>
						              	<div class="value_area">
							              	${item1.q_emp_name4 }
						              	</div>
							       	</c:if>
							       	<c:if test="${item.bizNo==2 && item.bizNo==item1.bizNo}">
						       			<div class="value_area">
							              	${item1.q_emp_name1 }
						              	</div>
						       			<div class="value_area">
							              	${item1.q_emp_name2 }
						              	</div>
						              	<div class="value_area">
							              	${item1.q_emp_name3 }
						              	</div>
						              	<div class="value_area">
							              	${item1.q_emp_name4 }
						              	</div>
							       	</c:if>
					       		</c:forEach>
			       			</c:if>
			       		</c:if>
						<c:if test="${item.bizNo==3 }">
			       			<div class="teamTouchContent2">
				       			<c:if test="${not empty contactCustList }">
				       				<c:forEach var="item2" items="${contactCustList }" varStatus="status2">
						       			<c:if test="${item.bizNo==3 && item.bizNo==item2.bizNo}">
							       			<div class="value_area">
								              	${item2.cust_name }
								            </div>
								            <div class="ymd_area">
								           		${item2.birthdayDate }
								           	</div>
			              				</c:if>
		              				</c:forEach>
				       			</c:if>
			       			</div>
			       			
				       	</c:if>
						<c:if test="${item.bizNo==4 }">
							<c:forEach var="item3" items="${ideaList }">
								<div class="leftAlgin idea_area">
					              	${item3.teamtTouch_idea }
					            </div>
							</c:forEach>
						</c:if>
						<%-- 
						<div class="teamTouchContent">
							${item.answer }
						</div> 
						--%>
						
					</div>
					
				</c:if>
				<c:if test="${paramDay==today && authType=='C' && item.bizNo !=1  && item.bizNo !=2}">
					<div class="score">
						<span><input type="radio" name="q_${item.bizNo }" value="0" <c:if test="${item.score==0 }">checked="checked"</c:if>> 0점</span>
						<span><input type="radio" name="q_${item.bizNo }" value="1" <c:if test="${item.score==1 }">checked="checked"</c:if>> 1점</span>
						<span><input type="radio" name="q_${item.bizNo }" value="2" <c:if test="${item.score==2 }">checked="checked"</c:if>> 2점</span>
						<span><input type="radio" name="q_${item.bizNo }" value="3" <c:if test="${item.score==3 }">checked="checked"</c:if>> 3점</span>
						<span><input type="radio" name="q_${item.bizNo }" value="4" <c:if test="${item.score==4 }">checked="checked"</c:if>> 4점</span>
						<span><input type="radio" name="q_${item.bizNo }" value="5" <c:if test="${item.score==5 }">checked="checked"</c:if>> 5점</span>
					</div>
				</c:if>	
				
				
				<!--//질문 _0${item.bizNo } -->
			</c:forEach>
			  
			<!-- 총평 --> 
			<div class="T_speech">
				<span class="Qs">총 평</span> 
				<c:if test="${paramDay!=today || authType!='C'}">
					<div class="teamTouchContent">
						${detail.remarks }
					</div> 
				</c:if>
				<c:if test="${paramDay==today && authType=='C'}">
					<textarea name="remarks" class="As">${detail.remarks }</textarea>      
				</c:if>
			</div> 
			<c:if test="${authType=='C'}">   
				<c:if test="${paramDay==today }">
					<div class="right_area" >
						<input type="hidden" name="listMode" value="${listMode }"/>
						<input type="hidden" name="page" value="${page }" >
						<input type="hidden" name="sYear" value="${sYear }" >
						<input type="hidden" name="sMonth" value="${sMonth }" >
						<input type="hidden" name="typeSelect" value="${typeSelect }">
						<input type="hidden" name="input"   value="${input }">
				   		<button id="btn_save" type="button" class="btn_blue">저장</button>
				   		<button id="btn_cancel" type="button" class="btn_gray">취소</button>
				   	</div> 
			   	</c:if>
	   		</c:if> 
		   	<c:if test="${authType!='C'}">    
				<div class="right_area" >
			   		<button id="btn_cancel" type="button" class="btn_gray">목록</button>
			   	</div> 
		   	</c:if>
		</form>
	</div>    
</body>
</html>
